.class Lcom/instagram/android/feed/a/g;
.super Ljava/lang/Object;
.source "FeedAdapter.java"


# instance fields
.field final synthetic a:Lcom/instagram/android/feed/a/a;

.field private b:Z

.field private final c:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/instagram/j/l;",
            ">;"
        }
    .end annotation
.end field

.field private final d:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/instagram/j/l;",
            ">;"
        }
    .end annotation
.end field

.field private final e:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/instagram/j/l;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method private constructor <init>(Lcom/instagram/android/feed/a/a;)V
    .locals 1
    .parameter

    .prologue
    .line 893
    iput-object p1, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 895
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/android/feed/a/g;->b:Z

    .line 897
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/feed/a/g;->c:Ljava/util/Map;

    .line 898
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    .line 899
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    return-void
.end method

.method synthetic constructor <init>(Lcom/instagram/android/feed/a/a;Lcom/instagram/android/feed/a/b;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 893
    invoke-direct {p0, p1}, Lcom/instagram/android/feed/a/g;-><init>(Lcom/instagram/android/feed/a/a;)V

    return-void
.end method

.method static synthetic a(Lcom/instagram/android/feed/a/g;)V
    .locals 0
    .parameter

    .prologue
    .line 893
    invoke-direct {p0}, Lcom/instagram/android/feed/a/g;->h()V

    return-void
.end method

.method private a(Lcom/instagram/j/l;)V
    .locals 4
    .parameter

    .prologue
    const/4 v2, 0x1

    const/4 v3, 0x0

    .line 1018
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-virtual {v0}, Lcom/instagram/android/feed/a/a;->o()Lcom/instagram/android/feed/a/i;

    move-result-object v0

    sget-object v1, Lcom/instagram/android/feed/a/i;->a:Lcom/instagram/android/feed/a/i;

    if-ne v0, v1, :cond_0

    .line 1019
    invoke-static {}, Lcom/instagram/f/b/c;->a()Lcom/instagram/f/b/c;

    move-result-object v0

    new-array v1, v2, [Ljava/lang/String;

    invoke-virtual {p1}, Lcom/instagram/j/l;->y()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v3

    invoke-virtual {v0, v1}, Lcom/instagram/f/b/c;->a([Ljava/lang/String;)V

    .line 1023
    :goto_0
    return-void

    .line 1021
    :cond_0
    invoke-static {}, Lcom/instagram/f/b/c;->a()Lcom/instagram/f/b/c;

    move-result-object v0

    new-array v1, v2, [Ljava/lang/String;

    invoke-virtual {p1}, Lcom/instagram/j/l;->e()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v3

    invoke-virtual {v0, v1}, Lcom/instagram/f/b/c;->a([Ljava/lang/String;)V

    goto :goto_0
.end method

.method static synthetic b(Lcom/instagram/android/feed/a/g;)I
    .locals 1
    .parameter

    .prologue
    .line 893
    invoke-direct {p0}, Lcom/instagram/android/feed/a/g;->g()I

    move-result v0

    return v0
.end method

.method private f()I
    .locals 2

    .prologue
    .line 997
    const/4 v0, 0x0

    .line 999
    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    iget-object v1, v1, Lcom/instagram/android/feed/a/a;->a:Lcom/instagram/android/fragment/d;

    invoke-virtual {v1}, Lcom/instagram/android/fragment/d;->g()Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    iget-object v1, v1, Lcom/instagram/android/feed/a/a;->a:Lcom/instagram/android/fragment/d;

    invoke-virtual {v1}, Lcom/instagram/android/fragment/d;->af()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 1000
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v1}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/android/feed/a/a;)I

    move-result v1

    rem-int/2addr v0, v1

    .line 1002
    :cond_0
    return v0
.end method

.method private g()I
    .locals 1

    .prologue
    .line 1006
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method private h()V
    .locals 2

    .prologue
    .line 1026
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/j/l;

    .line 1027
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/a/g;->a(Lcom/instagram/j/l;)V

    goto :goto_0

    .line 1029
    :cond_0
    return-void
.end method


# virtual methods
.method public a(I)Lcom/instagram/j/l;
    .locals 1
    .parameter

    .prologue
    .line 902
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/j/l;

    return-object v0
.end method

.method public a()V
    .locals 3

    .prologue
    .line 956
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 958
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/j/l;

    .line 959
    iget-object v2, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-virtual {v2, v0}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/j/l;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 960
    iget-object v2, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 963
    :cond_1
    return-void
.end method

.method public a(Ljava/util/ArrayList;Z)V
    .locals 7
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/instagram/j/l;",
            ">;Z)V"
        }
    .end annotation

    .prologue
    const/4 v3, 0x0

    .line 920
    .line 923
    if-eqz p1, :cond_1

    .line 924
    invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v5

    move v2, v3

    move v4, v3

    :goto_0
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_2

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/j/l;

    .line 925
    invoke-virtual {v0}, Lcom/instagram/j/l;->c()Ljava/lang/String;

    move-result-object v6

    .line 926
    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->c:Ljava/util/Map;

    invoke-interface {v1, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/instagram/j/l;

    .line 928
    if-nez v1, :cond_5

    .line 929
    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->c:Ljava/util/Map;

    invoke-interface {v1, v6, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 931
    if-eqz p2, :cond_0

    .line 932
    iget-object v4, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    add-int/lit8 v1, v2, 0x1

    invoke-virtual {v4, v2, v0}, Ljava/util/ArrayList;->add(ILjava/lang/Object;)V

    move v2, v1

    .line 936
    :goto_1
    invoke-direct {p0, v0}, Lcom/instagram/android/feed/a/g;->a(Lcom/instagram/j/l;)V

    .line 937
    const/4 v1, 0x1

    move v0, v2

    :goto_2
    move v2, v0

    move v4, v1

    .line 939
    goto :goto_0

    .line 934
    :cond_0
    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_1

    :cond_1
    move v4, v3

    .line 942
    :cond_2
    if-eqz v4, :cond_3

    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->c(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/h;

    move-result-object v0

    if-eqz v0, :cond_3

    .line 943
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->c(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/h;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    invoke-interface {v0, v1}, Lcom/instagram/android/feed/a/h;->a(Ljava/util/List;)V

    .line 947
    :cond_3
    iget-boolean v0, p0, Lcom/instagram/android/feed/a/g;->b:Z

    if-eqz v0, :cond_4

    .line 948
    iput-boolean v3, p0, Lcom/instagram/android/feed/a/g;->b:Z

    .line 949
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->d(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/f;

    move-result-object v0

    if-eqz v0, :cond_4

    .line 950
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->d(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/f;

    move-result-object v0

    invoke-interface {v0}, Lcom/instagram/android/feed/a/f;->a()V

    .line 953
    :cond_4
    return-void

    :cond_5
    move v0, v2

    move v1, v4

    goto :goto_2
.end method

.method public b(I)Ljava/util/ArrayList;
    .locals 5
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/instagram/j/l;",
            ">;"
        }
    .end annotation

    .prologue
    .line 906
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 907
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/android/feed/a/a;)I

    move-result v0

    mul-int v2, p1, v0

    .line 909
    const/4 v0, 0x0

    :goto_0
    iget-object v3, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v3}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/android/feed/a/a;)I

    move-result v3

    if-ge v0, v3, :cond_1

    .line 910
    add-int v3, v2, v0

    .line 911
    invoke-direct {p0}, Lcom/instagram/android/feed/a/g;->g()I

    move-result v4

    if-ge v3, v4, :cond_0

    .line 912
    invoke-virtual {p0, v3}, Lcom/instagram/android/feed/a/g;->a(I)Lcom/instagram/j/l;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 909
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 916
    :cond_1
    return-object v1
.end method

.method public b()V
    .locals 1

    .prologue
    .line 966
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/feed/a/g;->b:Z

    .line 968
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->c:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->clear()V

    .line 969
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 970
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 972
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->c(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/h;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 973
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->c(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/h;

    move-result-object v0

    invoke-interface {v0}, Lcom/instagram/android/feed/a/h;->a()V

    .line 975
    :cond_0
    return-void
.end method

.method public c()I
    .locals 4

    .prologue
    .line 980
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->e(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/i;

    move-result-object v0

    sget-object v1, Lcom/instagram/android/feed/a/i;->a:Lcom/instagram/android/feed/a/i;

    if-ne v0, v1, :cond_0

    .line 981
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    invoke-direct {p0}, Lcom/instagram/android/feed/a/g;->f()I

    move-result v1

    sub-int/2addr v0, v1

    .line 989
    :goto_0
    return v0

    .line 982
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v0}, Lcom/instagram/android/feed/a/a;->e(Lcom/instagram/android/feed/a/a;)Lcom/instagram/android/feed/a/i;

    move-result-object v0

    sget-object v1, Lcom/instagram/android/feed/a/i;->b:Lcom/instagram/android/feed/a/i;

    if-ne v0, v1, :cond_3

    .line 986
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    iget-object v0, v0, Lcom/instagram/android/feed/a/a;->a:Lcom/instagram/android/fragment/d;

    invoke-virtual {v0}, Lcom/instagram/android/fragment/d;->g()Z

    move-result v0

    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    iget-object v0, v0, Lcom/instagram/android/feed/a/a;->a:Lcom/instagram/android/fragment/d;

    invoke-virtual {v0}, Lcom/instagram/android/fragment/d;->ag()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 987
    :cond_1
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    int-to-double v0, v0

    iget-object v2, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v2}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/android/feed/a/a;)I

    move-result v2

    int-to-double v2, v2

    div-double/2addr v0, v2

    invoke-static {v0, v1}, Ljava/lang/Math;->floor(D)D

    move-result-wide v0

    double-to-int v0, v0

    goto :goto_0

    .line 989
    :cond_2
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    int-to-double v0, v0

    iget-object v2, p0, Lcom/instagram/android/feed/a/g;->a:Lcom/instagram/android/feed/a/a;

    invoke-static {v2}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/android/feed/a/a;)I

    move-result v2

    int-to-double v2, v2

    div-double/2addr v0, v2

    invoke-static {v0, v1}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v0

    double-to-int v0, v0

    goto :goto_0

    .line 992
    :cond_3
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "View mode not handled"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public d()Z
    .locals 1

    .prologue
    .line 1010
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/g;->c()I

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public e()Z
    .locals 1

    .prologue
    .line 1014
    iget-object v0, p0, Lcom/instagram/android/feed/a/g;->e:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
